<%@page import="com.itwill.ecom.ordersDetail.OrdersDetailBeans"%>
<%@page import="com.itwill.ecom.ordersDetail.OrdersDetailService"%>
<%@page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	/*
	 ODETAIL_NO NUMBER(10) NOT NULL PRIMARY KEY,
	 ODETAIL_ORDERSNO NUMBER(10) NOT NULL,
	 ODETAIL_PRODUCT NUMBER(10) NOT NULL,
	 ODETAIL_COUNT NUMBER(10) NOT NULL,
	 CONSTRAINT ORDERSDETAIL_FK_ORDERSNO FOREIGN KEY (ODETAIL_ORDERSNO)
     REFERENCES ORDERS(ORDERS_NO) ON DELETE SET NULL,
	 CONSTRAINT ORDERSDETAIL_FK_PRODUCT FOREIGN KEY (ODETAIL_PRODUCT)
     REFERENCES PRODUCT(PRODUCT_NO) ON DELETE SET NULL
	 ============================================
	 ORDERS_NO NUMBER(10) NOT NULL PRIMARY KEY,
	 ORDERS_MEMBER NUMBER(10) NOT NULL,
	 ORDERS_DATE DATE DEFAULT SYSDATE NOT NULL,
	 ORDERS_PHONE VARCHAR2(20) NOT NULL,
	 ORDERS_ZIP VARCHAR2(20) NOT NULL,
	 ORDERS_ADDR1 VARCHAR2(50) NOT NULL,
	 ORDERS_ADDR2 VARCHAR2(50) NOT NULL,
	 ORDERS_PRICE VARCHAR2(20) NOT NULL,
	 ORDERS_PAYMENTS VARCHAR2(50) NOT NULL,
	 ORDERS_MSG VARCHAR2(100),
	 CONSTRAINT ORDERS_FK_MEMBER FOREIGN KEY (ORDERS_MEMBER)
     REFERENCES MEMBER(MEMBER_NO) ON DELETE SET NULL
	 */
	WebApplicationContext webContext = WebApplicationContextUtils
			.getWebApplicationContext(application);
	OrdersDetailService ordersDetailService = (OrdersDetailService) webContext
			.getBean("ordersDetailService");
	
	
	int odetailNo = Integer.parseInt(request.getParameter("odetail_no"));
	int odetailOrdersNo = Integer.parseInt(request.getParameter("odetail_ordersno"));
	int odetailProduct = Integer.parseInt(request.getParameter("odetail_product"));
	int odetailCount = Integer.parseInt(request.getParameter("odetail_count"));
	
	OrdersDetailBeans beans = new OrdersDetailBeans(odetailNo, odetailOrdersNo, odetailProduct, odetailCount);
	
	ordersDetailService.createOrdersDetail(beans);
%>